<template>
  <div>

      <van-button v-for="i in list" :key="i.id" @click="select(i.rid)"> {{i.resource}} </van-button>

        <div id="main" style="height: 300px;width: 400px">
        </div>

  </div>
</template>

<script>
import * as echarts from 'echarts';
// import axios from 'axios'
export default {
    data(){
        return{
            list:JSON.parse(localStorage.getItem('list'))

        }
    },

    methods:{


            getdata(){
            var chartDom = document.getElementById('main');
            var myChart = echarts.init(chartDom);
            var option;
            option = {
                xAxis: {
                type: 'category',
                data: this.tlist
                },
                yAxis: {
                type: 'value'
                },
                series: [
                {
                    data: this.dlist,
                    type: 'line'
                }
                ]
            };
            option && myChart.setOption(option);
            },



















            select(id){
                if(id=='1'){
                    this.$router.push("/app")
                }else if(id=='2'){
                    this.$router.push("/")
                }else if(id=='3'){
                    this.$router.push("/")
                }
            }
    },

    mounted(){
        
        setInterval(this.getlist1,50000)
    }

}
</script>

<style>

</style>